﻿using System;
using System.Threading;
using System.Globalization;
using System.Resources;

namespace Hxsoft.AppV1.Module
{
	internal sealed partial class SR
	{
		#region
		private ResourceManager resources;
		private static SR loader;
		private static object s_InternalSyncObject;

		// Methods
		internal SR()
		{
			this.resources = new ResourceManager("Hxsoft.AppV1.Module.Res", base.GetType().Assembly);
		}

		private static SR GetLoader()
		{
			if (loader == null)
			{
				lock (InternalSyncObject)
				{
					if (loader == null)
					{
						loader = new SR();
					}
				}
			}
			return loader;
		}

		public static object GetObject(string name)
		{
			SR loader = GetLoader();
			if (loader == null)
			{
				return null;
			}
			return loader.resources.GetObject(name, Culture);
		}

		public static string GetString(string name)
		{
			SR loader = GetLoader();
			if (loader == null)
			{
				return null;
			}
			return loader.resources.GetString(name, Culture);
		}

		public static string GetString(string name, params object[] args)
		{
			SR loader = GetLoader();
			if (loader == null)
			{
				return null;
			}
			string format = loader.resources.GetString(name, Culture);
			if ((args == null) || (args.Length <= 0))
			{
				return format;
			}
			for (int i = 0; i < args.Length; i++)
			{
				string str2 = args[i] as string;
				if ((str2 != null) && (str2.Length > 0x400))
				{
					args[i] = str2.Substring(0, 0x3fd) + "...";
				}
			}
			return string.Format(CultureInfo.CurrentCulture, format, args);
		}

		// Properties
		private static CultureInfo Culture
		{
			get
			{
				return null;
			}
		}

		private static object InternalSyncObject
		{
			get
			{
				if (s_InternalSyncObject == null)
				{
					object obj2 = new object();
					Interlocked.CompareExchange(ref s_InternalSyncObject, obj2, null);
				}
				return s_InternalSyncObject;
			}
		}

		public static ResourceManager Resources
		{
			get
			{
				return GetLoader().resources;
			}
		}
		#endregion
	}
}
